package main

import (
	"gin/cdai"
	Mysql "gin/database"
	"gin/service"
	"github.com/spf13/viper"
	"os"
)

func main() {
	InitConfig()
	cdai.Init()
	Mysql.InitDB()
	//var fileName = "/data/PSEMryxLwy_5ac65dbe30f71790c29a2ce82f292d8f/PSEMryxLwy_5ac65dbe30f71790c29a2ce82f292d8f.wav"
	//var callback = "http://10.168.30.191:8080/task/ai_task_call_back"
	//resp, err := task.CreateVoiceTask(fileName, callback)

	media, err := service.CreateMediaAnalysisTask(1498)

	if err != nil {
		println(err.Error())
		return
	}
	println(media.TaskUUID)

}

func InitConfig() {
	workDir, _ := os.Getwd()
	viper.SetConfigName("application")
	viper.SetConfigType("yml")
	viper.AddConfigPath(workDir + "/config")
	err := viper.ReadInConfig()
	if err != nil {
		panic(err)
	}
}
